//
//  GameMaster.h
//  DualSnake
//
//  Created by HacJune Lee on 13. 12. 10..
//  Copyright (c) 2013년 HakJune Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GameBlock.h"

@protocol GameMasterProtocol <NSObject>
-(void)playTimeTic:(int)playTime;
-(void)createItem:(int)itemType;
@end

@interface GameMaster : NSObject
{
    NSTimer * playTimer;
    int playTimeCount;
}

@property id<GameMasterProtocol> delegate;

@property int player1_nextDirection;
@property int player2_nextDirection;

+(GameMaster*)shared;

-(int)getWallWith;
-(int)getGridCount;
-(int)getSingleModePlayerStartGridNum;
-(int)getInputDirectionWithSnakeTag:(int)tag;

-(float)getGridWidth;

-(CGSize)getGridSize;
-(CGSize)getDisplaySize;

-(void)setTimer;
-(void)checkItemRooting:(GameBlock*)gameblock;

-(int)convertCGpointToGridNum:(CGPoint)point;
-(CGPoint)convertGridNumToCGPoing:(int)gridNum;
@end
